3.799 \(\int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx\)

Optimal. Leaf size=45 \[ \frac{a \tan ^3(c+d x)}{3 d}+\frac{a \sec ^3(c+d x)}{3 d}-\frac{a \sec (c+d x)}{d} \]

[Out]

-((a*Sec[c + d*x])/d) + (a*Sec[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Rubi [A]  time = 0.103911, antiderivative size = 45, normalized size of antiderivative = 1., number of steps used = 5, number of rules used = 4, integrand size = 27, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.148, Rules used = {2838, 2607, 30, 2606} \[ \frac{a \tan ^3(c+d x)}{3 d}+\frac{a \sec ^3(c+d x)}{3 d}-\frac{a \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^2*(a + a*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-((a*Sec[c + d*x])/d) + (a*Sec[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^3)/(3*d)

Rule 2838

Int[(cos[(e_.) + (f_.)*(x_)]*(g_.))^(p_)*((d_.)*sin[(e_.) + (f_.)*(x_)])^(n_.)*((a_) + (b_.)*sin[(e_.) + (f_.)
*(x_)]), x_Symbol] :> Dist[a, Int[(g*Cos[e + f*x])^p*(d*Sin[e + f*x])^n, x], x] + Dist[b/d, Int[(g*Cos[e + f*x
])^p*(d*Sin[e + f*x])^(n + 1), x], x] /; FreeQ[{a, b, d, e, f, g, n, p}, x]

Rule 2607

Int[sec[(e_.) + (f_.)*(x_)]^(m_)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[1/f, Subst[Int[(b*x)
^n*(1 + x^2)^(m/2 - 1), x], x, Tan[e + f*x]], x] /; FreeQ[{b, e, f, n}, x] && IntegerQ[m/2] &&  !(IntegerQ[(n
- 1)/2] && LtQ[0, n, m - 1])

Rule 30

Int[(x_)^(m_.), x_Symbol] :> Simp[x^(m + 1)/(m + 1), x] /; FreeQ[m, x] && NeQ[m, -1]

Rule 2606

Int[((a_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((b_.)*tan[(e_.) + (f_.)*(x_)])^(n_.), x_Symbol] :> Dist[a/f, Subst[
Int[(a*x)^(m - 1)*(-1 + x^2)^((n - 1)/2), x], x, Sec[e + f*x]], x] /; FreeQ[{a, e, f, m}, x] && IntegerQ[(n -
1)/2] &&  !(IntegerQ[m/2] && LtQ[0, m, n + 1])

Rubi steps

\begin{align*} \int \sec ^2(c+d x) (a+a \sin (c+d x)) \tan ^2(c+d x) \, dx &=a \int \sec ^2(c+d x) \tan ^2(c+d x) \, dx+a \int \sec (c+d x) \tan ^3(c+d x) \, dx\\ &=\frac{a \operatorname{Subst}\left (\int x^2 \, dx,x,\tan (c+d x)\right )}{d}+\frac{a \operatorname{Subst}\left (\int \left (-1+x^2\right ) \, dx,x,\sec (c+d x)\right )}{d}\\ &=-\frac{a \sec (c+d x)}{d}+\frac{a \sec ^3(c+d x)}{3 d}+\frac{a \tan ^3(c+d x)}{3 d}\\ \end{align*}

Mathematica [A]  time = 0.0373222, size = 45, normalized size = 1. \[ \frac{a \tan ^3(c+d x)}{3 d}+\frac{a \sec ^3(c+d x)}{3 d}-\frac{a \sec (c+d x)}{d} \]

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^2*(a + a*Sin[c + d*x])*Tan[c + d*x]^2,x]

[Out]

-((a*Sec[c + d*x])/d) + (a*Sec[c + d*x]^3)/(3*d) + (a*Tan[c + d*x]^3)/(3*d)

________________________________________________________________________________________

Maple [A]  time = 0.055, size = 82, normalized size = 1.8 \begin{align*}{\frac{1}{d} \left ( a \left ({\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{3\, \left ( \cos \left ( dx+c \right ) \right ) ^{3}}}-{\frac{ \left ( \sin \left ( dx+c \right ) \right ) ^{4}}{3\,\cos \left ( dx+c \right ) }}-{\frac{ \left ( 2+ \left ( \sin \left ( dx+c \right ) \right ) ^{2} \right ) \cos \left ( dx+c \right ) }{3}} \right ) +{\frac{a \left ( \sin \left ( dx+c \right ) \right ) ^{3}}{3\, \left ( \cos \left ( dx+c \right ) \right ) ^{3}}} \right ) } \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x)

[Out]

1/d*(a*(1/3*sin(d*x+c)^4/cos(d*x+c)^3-1/3*sin(d*x+c)^4/cos(d*x+c)-1/3*(2+sin(d*x+c)^2)*cos(d*x+c))+1/3*a*sin(d
*x+c)^3/cos(d*x+c)^3)

________________________________________________________________________________________

Maxima [A]  time = 1.01503, size = 53, normalized size = 1.18 \begin{align*} \frac{a \tan \left (d x + c\right )^{3} - \frac{{\left (3 \, \cos \left (d x + c\right )^{2} - 1\right )} a}{\cos \left (d x + c\right )^{3}}}{3 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="maxima")

[Out]

1/3*(a*tan(d*x + c)^3 - (3*cos(d*x + c)^2 - 1)*a/cos(d*x + c)^3)/d

________________________________________________________________________________________

Fricas [A]  time = 1.53109, size = 127, normalized size = 2.82 \begin{align*} \frac{a \cos \left (d x + c\right )^{2} - 2 \, a \sin \left (d x + c\right ) + a}{3 \,{\left (d \cos \left (d x + c\right ) \sin \left (d x + c\right ) - d \cos \left (d x + c\right )\right )}} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="fricas")

[Out]

1/3*(a*cos(d*x + c)^2 - 2*a*sin(d*x + c) + a)/(d*cos(d*x + c)*sin(d*x + c) - d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F(-1)]  time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**4*sin(d*x+c)**2*(a+a*sin(d*x+c)),x)

[Out]

Timed out

________________________________________________________________________________________

Giac [A]  time = 1.26336, size = 90, normalized size = 2. \begin{align*} -\frac{\frac{3 \, a}{\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 1} - \frac{3 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right )^{2} - 12 \, a \tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) + 5 \, a}{{\left (\tan \left (\frac{1}{2} \, d x + \frac{1}{2} \, c\right ) - 1\right )}^{3}}}{6 \, d} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^4*sin(d*x+c)^2*(a+a*sin(d*x+c)),x, algorithm="giac")

[Out]

-1/6*(3*a/(tan(1/2*d*x + 1/2*c) + 1) - (3*a*tan(1/2*d*x + 1/2*c)^2 - 12*a*tan(1/2*d*x + 1/2*c) + 5*a)/(tan(1/2
*d*x + 1/2*c) - 1)^3)/d